//============================================================================
// Name        : QueryResult.cpp
// Author      : lucmir@dcc.ufmg.br
// Description :
//============================================================================


#include "QueryResult.h"


QueryResult::QueryResult(std::string term, unsigned int tf, unsigned int *docFreqs)
	: term(term), tf(tf), docFreqs(docFreqs) {
}

QueryResult::~QueryResult() {
}

std::string QueryResult::getTerm() {
	return this->term;
}

unsigned int QueryResult::getTf() {
	return this->tf;
}

void QueryResult::setTerm(std::string term) {
	this->term = term;
}

void QueryResult::setTf(unsigned int tf) {
	this->tf = tf;
}

unsigned int *QueryResult::getDocFreqs() {
	return this->docFreqs;
}

void QueryResult::setDocFreqs(unsigned int *docFreqs) {
	this->docFreqs = docFreqs;
}

void QueryResult::printDocFreqs() {
	std::cout << "\tTermo: \"" << this->term << "\"\n";
	std::cout << "\tTF: " << this->tf << "\n";
	std::cout << "\tOcorrências:";
	for(unsigned int i=0; i<this->tf*2; i+=2) {
		std::cout << " (D:" << this->docFreqs[i] << ",F:" << this->docFreqs[i+1] << ")";
	}
	std::cout << "\n";
}

